﻿// Copyright 2009 Mike Geise
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Falcon.Core.Services
{
	using Falcon.Core.Collections;
	using Falcon.Core.Domain;
	using Falcon.Core.Domain.Repositories;
	using Falcon.Core.Domain.Services;

	public class UserGroupCommentService : IUserGroupCommentService
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="UserGroupCommentService"/> class.
		/// </summary>
		/// <param name="userGroupCommentRepository">The user group comment repository.</param>
		public UserGroupCommentService(IUserGroupCommentRepository userGroupCommentRepository)
		{
			this.UserGroupCommentRepository = userGroupCommentRepository;
		}

		/// <summary>
		/// Gets or sets the user group comment repository.
		/// </summary>
		/// <value>The user group comment repository.</value>
		public IUserGroupCommentRepository UserGroupCommentRepository
		{
			get; 
			private set;
		}

		/// <summary>
		/// Gets the user group comment by id.
		/// </summary>
		/// <param name="id">The id.</param>
		/// <returns></returns>
		public UserGroupComment GetById(int id)
		{
			return this.UserGroupCommentRepository.GetById(id);
		}

		/// <summary>
		/// Gets all the users group comments.
		/// </summary>
		/// <param name="specification">The <see cref="UserGroupCommentSpecification"/>.</param>
		/// <returns></returns>
		public IPagedList<UserGroupComment, UserGroupCommentSpecification> GetPaged(UserGroupCommentSpecification specification)
		{
			return this.UserGroupCommentRepository.GetPaged(specification);
		}

		/// <summary>
		/// Creates the user group comment.
		/// </summary>
		/// <returns></returns>
		public UserGroupComment Create()
		{
			return new UserGroupComment();
		}

		/// <summary>
		/// Inserts the user group comment into the storage.
		/// </summary>
		/// <param name="comment">The comment.</param>
		public void Insert(UserGroupComment comment)
		{
			this.UserGroupCommentRepository.Insert(comment);
		}

		/// <summary>
		/// Deletes the user group comment in the storage.
		/// </summary>
		/// <param name="comment">The comment.</param>
		public void Delete(UserGroupComment comment)
		{
			this.UserGroupCommentRepository.Delete(comment);
		}
	}
}